# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-shodan
_pkgname=shodan
pkgver=1.28.0
pkgrel=1
pkgdesc='Python library and command-line utility for Shodan (https://developer.shodan.io).'
groups=('blackarch' 'blackarch-recon' 'blackarch-scanner'
        'blackarch-automation')
arch=('any')
url='https://pypi.org/project/shodan/#files'
depends=('python2' 'python2-requests' 'python2-simplejson' 'python2-click'
         'python2-click-plugins' 'python2-xlsxwriter' 'python2-colorama')
makedepends=('python2-setuptools')
license=('MIT')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('d79c6d3500dc618bbe79d0b8bba46f60638e68a83286a505a5598851d0158b1d29ce9904e38c57b63a25bff52a618aef7d781cbf85a0f5da6bad42cd140327a5')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${_pkgname}2"
}

